🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / androidApp / src / fdroid / kotlin / org / meshtastic / app / map / traceroute / TracerouteMap.kt
Displaying Raw • Download
androidApp/src/fdroid/kotlin/org/meshtastic/app/map/traceroute/TracerouteMap.kt renovate/fastlane-2.x-lockfile (056eed64) Text, 3.01 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.app.map.traceroute
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.LaunchedEffect
Tff7b72import T7ee787androidx.compose.runtime.getValue
Tff7b72import T7ee787androidx.compose.runtime.rememberUpdatedState
Tff7b72import T7ee787androidx.compose.ui.Modifier
Tff7b72import T7ee787androidx.lifecycle.compose.collectAsStateWithLifecycle
Tff7b72import T7ee787org.koin.compose.viewmodel.koinViewModel
Tff7b72import T7ee787org.meshtastic.app.map.androidCustomRasterBasemaps
Tff7b72import T7ee787org.meshtastic.core.model.TracerouteOverlay
Tff7b72import T7ee787org.meshtastic.feature.map.SharedMapViewModel
Tff7b72import T7ee787org.meshtastic.feature.map.maplibre.MapLibreTracerouteMap
Tff7b72import T7ee787org.meshtastic.feature.map.tracerouteNodeSelection
Tff7b72import T7ee787org.meshtastic.proto.Position
T8b949e/** Flavor-unified entry point for the embeddable traceroute map. MapLibre implementation. */
Tf0883e@Composable
Tff7b72fun Td2a8ffTracerouteMapTb4b4b4(
Te6edf3tracerouteOverlayTb4b4b4: Te6edf3TracerouteOverlay?Tb4b4b4,
Te6edf3tracerouteNodePositionsTb4b4b4: Te6edf3MapTff7b72<Tffa657IntTb4b4b4, Te6edf3PositionTff7b72>Tb4b4b4,
Te6edf3onMappableCountChangeTb4b4b4: Tb4b4b4(Te6edf3shownTb4b4b4: Tffa657IntTb4b4b4, Te6edf3totalTb4b4b4: Tffa657IntTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3modifierTb4b4b4: Te6edf3Modifier Tff7b72= Te6edf3ModifierTb4b4b4,
Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3viewModelTb4b4b4: Te6edf3SharedMapViewModel Tff7b72= Te6edf3koinViewModelTb4b4b4(Tb4b4b4)
T8b949e// The effect below restarts on hop-count changes; capturing the callback keeps a recomposition
T8b949e// with a fresh lambda from firing a stale one.
Tff7b72val Te6edf3reportCount Tff7b72by Te6edf3rememberUpdatedStateTb4b4b4(Te6edf3onMappableCountChangeTb4b4b4)
Tff7b72val Te6edf3nodes Tff7b72by Te6edf3viewModelTb4b4b4.Te6edf3nodesTb4b4b4.Te6edf3collectAsStateWithLifecycleTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3selection Tff7b72=
Te6edf3viewModelTb4b4b4.Te6edf3tracerouteNodeSelectionTb4b4b4(
Te6edf3tracerouteOverlay Tff7b72= Te6edf3tracerouteOverlayTb4b4b4,
Te6edf3tracerouteNodePositions Tff7b72= Te6edf3tracerouteNodePositionsTb4b4b4,
Te6edf3nodes Tff7b72= Te6edf3nodesTb4b4b4,
Tb4b4b4)
T8b949e// The host shows "n of m hops mappable"; m counts every hop the traceroute named, n only those
T8b949e// we can actually place, so a route through nodes we have never heard from still reports honestly.
Te6edf3LaunchedEffectTb4b4b4(Te6edf3selectionTb4b4b4.Te6edf3nodeLookupTb4b4b4.Te6edf3sizeTb4b4b4, Te6edf3selectionTb4b4b4.Te6edf3overlayNodeNumsTb4b4b4.Te6edf3sizeTb4b4b4) Tb4b4b4{
Te6edf3reportCountTb4b4b4(
Te6edf3selectionTb4b4b4.Te6edf3overlayNodeNumsTb4b4b4.Te6edf3count Tb4b4b4{ Te6edf3selectionTb4b4b4.Te6edf3nodeLookupTb4b4b4.Te6edf3containsKeyTb4b4b4(Tffa657itTb4b4b4) Tb4b4b4}Tb4b4b4,
Te6edf3selectionTb4b4b4.Te6edf3overlayNodeNumsTb4b4b4.Te6edf3sizeTb4b4b4,
Tb4b4b4)
Tb4b4b4}
Te6edf3MapLibreTracerouteMapTb4b4b4(
Te6edf3forwardRoute Tff7b72= Te6edf3tracerouteOverlayTff7b72?.Te6edf3forwardRouteTb4b4b4.Te6edf3orEmptyTb4b4b4(Tb4b4b4)Tb4b4b4,
Te6edf3returnRoute Tff7b72= Te6edf3tracerouteOverlayTff7b72?.Te6edf3returnRouteTb4b4b4.Te6edf3orEmptyTb4b4b4(Tb4b4b4)Tb4b4b4,
Te6edf3nodeLookup Tff7b72= Te6edf3selectionTb4b4b4.Te6edf3nodeLookupTb4b4b4,
Te6edf3modifier Tff7b72= Te6edf3modifierTb4b4b4,
Te6edf3customBasemaps Tff7b72= Tb4b4b4{ Te6edf3androidCustomRasterBasemapsTb4b4b4(Tb4b4b4) Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Served by rngit 1.5.2 - Generated in 0.22s